package com.wva.censor.controller;

import com.wva.censor.service.TextCensorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/censor")
@Api(tags = "审核微服务接口")
@Slf4j
public class CensorController {
    @Autowired
    TextCensorService textCensorService;

    @ApiOperation("审核文本")
    @PostMapping("/text")
    Boolean censorText(@RequestParam String content) throws Exception {
        return textCensorService.censor(content);
    }

    @ApiOperation("审核视频（暂未实现）")
    @PostMapping("/video")
    Boolean censorVideo(@RequestParam String url) throws Exception {
        return true;
    }

}
